'use strict';

module.exports = () => {
    /**
     * @param {Egg.Context} ctx - egg context
     * @param {import("koa").Next} next - koa next
     */
    return async function handle(ctx, next) {
        try {
            await next();
        } catch (error) {
            ctx.catchUserExceptions(error);
        }
    };
};
